<script setup >
import { appName } from '~/constants/index.js'
import { ElConfigProvider } from 'element-plus'
import zh from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'

useHead({
  title: appName,
})

const language = useCookie("language"); // 获取 Cookie

</script>

<template>
  <ElConfigProvider :locale="language == 'zh' ? zh : en">
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</ElConfigProvider>
</template>

<style>
html,
body, 
#__nuxt {
  height: 100vh;
  margin: 0;
  padding: 0;
}

html.light{
  background: #fafafa;
  color: #222;
}

html.dark {
  background: #222;
  color: #fff;
}
</style>
